package com.mdb.open.trade.domain.dto.trade;

import com.mdb.bc.api.data.DataObjectBase;
import com.mdb.bc.validator.annotaion.validation.Num;
import com.mdb.open.common.enums.trade.type.RemittancePurposeTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.Digits;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * @description:
 * @author: you.yichao
 * @create: 2019-07-10 15:45
 **/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="ClaimItemDto", description="认领列表Dto对象")
public class ClaimItemDto extends DataObjectBase {

    /**
     * 商户业务编号
     */
    @ApiModelProperty(value = "商户业务编号")
    @NotBlank(message = "商户业务编号不允许为空")
    @Size(max = 64, message = "商户业务编号最长为{max}位")
    private String businessNo;

    /**
     * 认领金额
     */
    @ApiModelProperty(value = "认领金额")
    @NotBlank(message = "认领金额不允许为空")
    @Digits(integer = 13, fraction = 2, message = "认领金额要输入阿拉伯数字（包含小数点及小数点后两位最大16位）")
    @Num(regexp = "([1-9]\\d*+(.[0-9]{1,2})?)|(0\\.[0-9]{1,2})", message = "认领金额要为正数且小数点及小数点后两位最大16位")
    @Size(max = 20, message = "认领金额最长为{max}位")
    private String claimAmount;

    /**
     * 用途
     */
    @ApiModelProperty(value = "用途")
    @NotNull(message = "用途不允许为空")
    private RemittancePurposeTypeEnum purposes;

}
